<?php echo $this->render('picture/category/_tab.phtml');?>
<div class="body">
<form action="" method="post" enctype="multipart/form-data">
<?php echo $this->form()->hidden('referer', $this->referer) . "\n";?>
	<table class="form">
		<tr>
			<th colspan="2"><?php if($this->row->getId()) { 
				echo '<span style="float:right;">';
				echo '<a href="'. $this->url('category/index', array('name' => $this->row->getName()))->assemble($this->row->getLocale()->getLang()) . '" target="_blank">';
				echo $this->language('Visit Frontend Page') . '..';
				echo '</a>';
				echo '</span>';
			}?><?php echo $this->language('CATEGORY INFORMATION');?>:</th>
		</tr>
		<tr>
			<td width="180"><label><?php echo $this->language('PARENT');?></label></td>
			<td><?php
			if($this->row->getId()) {
				echo $this->form()->hidden('parent_id', $this->row->getLocale()->getParentId());
				echo '<span class="show">';
				if(1 && $parent = $this->row->getParent()) {
					if(1 && $locale = $parent->getLocale($this->user->getLang())) {
						echo $locale->getTitle();
					}
					echo '[<em>' . $parent->getId() . '</em>]';
				} else {
					echo 'TOP CATEGORY';
				}
				echo '</span>';
			} else {
				echo $this->partial('picture/_inc/categorySelect.phtml', array('name' => 'parent_id', 'selectedId' => $this->row->getLocale()->getParentId()));
			}
			?></td>
		</tr>
		<tr>
			<td><label><span class="red">*</span> <?php echo $this->language('Title');?></label></td>
			<td><?php echo $this->form()->text('title', $this->row->getLocale()->getTitle(),array('size'=>'50', 'maxlength'=>'250'));?><code><?php echo $this->language('Between 1~100 characters');?>.</code></td>
		</tr>	
		<tr>
			<td><label><span class="red">*</span> <?php echo $this->language('KEY NAME');?></label></td>
			<td><?php echo $this->render('picture/_inc/keyNameInput.phtml');?></td>
		</tr>
		<tr>
			<td><label><?php echo $this->language('Display Order');?></label></td>
			<td><?php echo $this->form()->text('display_order', $this->row->getLocale()->getDisplayOrder(),array('size'=>'10', 'maxlength'=>'10'));?><code><?php echo $this->language('Numeric Only');?>.</code></td>
		</tr>
		<tr>
			<td><label><?php echo $this->language('Cover');?></label></td>
			<td><?php echo $this->partial('picture/_inc/uploadInput.phtml', array('image' => $this->row->getCover(), 'name' => 'cover', 'edit' => $this->row->getId()));?></td>
		</tr>
		<tr>
			<td><label><?php echo $this->language('Actived');?>?</label></td>
			<td><?php echo $this->form()->select('is_active', $this->row->getLocale()->getIsActive(), array(), array('0' => 'No', '1' => 'Yes'));?></td>
		</tr>
		<tr>
			<td><label><?php echo $this->language('Description');?></label></td>
			<td><?php echo $this->form()->textarea('description', $this->row->getLocale()->getDescription(), array('style' => 'width:95%;height:120px;'));?></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<button type="submit" name="submit" value="submit"><?php echo $this->language('Submit');?></button>
				<?php if($this->row->getId()) {
					echo '<a href="' . $this->url('picture/category/delete', array('id' => $this->row->getId())) . '" class="button">';
					echo $this->language('Delete');
					echo '</a>';
				}?>
			</td>
		</tr>
	</table>
</form>
</div>
